package fei.yuzhi.com.loveflowers.fragment.firstpagefragment.autoscroll;

import java.util.List;

import fei.yuzhi.com.loveflowers.bean.firstpageautobean.ItemBean;

/**
 * Created by My on 2016/10/10.
 */
public class AutoScrollJumpPresenter implements AutoScrollJumpContract.AutoScrollPresenter {
    private AutoScrollJumpContract.AutoScrollView view;
    private AutoScrollJumpContract.AutoScrollModel model;
    public AutoScrollJumpPresenter(AutoScrollJumpContract.AutoScrollView view){
        this.view=view;
        this.model=new AutoScrollJumpModel();
    }

    @Override
    public void getGridDataFromNet(final String data) {

        model.getGridViewData(data, new AutoScrollJumpModel.setOnGetGridViewDataLsitener() {
            @Override
            public void getGridData(List<ItemBean> itemBeanList,String title) {
                if (itemBeanList!=null){
                    view.onGridViewSuccess(itemBeanList,title);
                }else {
                    view.onGridViewFail("ViewPager跳转数据下载失败");
                }
            }
        });
    }
}
